/*
 * @Author: shanghongyun 2879455630@qq.com
 * @Date: 2025-05-30 15:38:13
 * @LastEditors: shanghongyun 2879455630@qq.com
 * @LastEditTime: 2025-06-18 14:18:47
 * @FilePath: \A05\Drive\display.h
 * @Description: display 模块头文件
 */


#ifndef __DISPLAY_H_
#define __DISPLAY_H_


#include "Base.h"
#include "dev.h"
#include "NM1120.h"

#include "battery.h"

#define DISPLAY_0           0x3F
#define DISPLAY_1           0x06
#define DISPLAY_2           0x5B
#define DISPLAY_3           0x4F
#define DISPLAY_4           0x66
#define DISPLAY_5           0x6D
#define DISPLAY_6           0x7D
#define DISPLAY_7           0x07
#define DISPLAY_8           0x7F
#define DISPLAY_9           0x6F


#define DISPLAY_ERR_E      0x79    /*E*/
#define DISPLAY_ERR_F      0x71    /*F*/
#define DISPLAY_ERR_0      0x3F    /*0*/


typedef struct{
    uint8_t ones;    /*个位*/
    uint8_t tens;    /*十位*/
    uint8_t hundreds;/*百位*/
}display_Num_t;


typedef struct{
    uint16_t voltage_bat    ;   /*电池电压显示:V*/
    uint16_t current_bat    ;   /*电池电流显示:A*/
    uint16_t capacity_bat   ;   /*电池容量显示:mAh*/
    uint16_t charge_time_bat;   /*充电时间显示:h+min*/

    display_Num_t vol_bat;    /*电压显示*/
    display_Num_t cur_bat;    /*电流显示*/
    display_Num_t cap_bat;    /*容量显示*/
    display_Num_t c_time_bat;    /*充电时间显示*/

    stage_t  stage_bat;       /*电池阶段*/
}bat_display_t;

typedef enum{
    IDLE_PAGE = 0,
    CHARGE_PAGE ,
    SET_CURRENT_PAGE ,
    ERROR_PAGE  ,
    CHARGE_END  
}show_page;

typedef struct{
    uint8_t flash_time;
    show_page page;
    void (*display_func[5])(void);
}display_Type;


// void Page_disp_process(void);

#endif

